package com.tdkj.service.information.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.tdkj.dao.information.IBeanBaseInfoDao;
import com.tdkj.dao.information.IBeanExpertDao;
import com.tdkj.model.information.BeanBaseInfo;
import com.tdkj.model.information.BeanExpert;
import com.tdkj.service.BaseService;
import com.tdkj.service.information.IBeanExpertService;
@Component("expertService")
public class BeanExpertImpl extends BaseService implements IBeanExpertService{
	private IBeanExpertDao beanExpertDao;
	private IBeanBaseInfoDao baseInfoDao;
	public IBeanBaseInfoDao getBaseInfoDao() {
		return baseInfoDao;
	}
	@Resource
	public void setBaseInfoDao(IBeanBaseInfoDao baseInfoDao) {
		this.baseInfoDao = baseInfoDao;
	}

	public IBeanExpertDao getBeanExpertDao() {
		return beanExpertDao;
	}

	@Resource
	public void setBeanExpertDao(IBeanExpertDao beanExpertDao) {
		this.beanExpertDao = beanExpertDao;
	}

	@Override
	public void updateStatus(Long id,String type) {
		// TODO Auto-generated method stub
		BeanExpert bean=beanExpertDao.findById(id, BeanExpert.class);
		if(type.equals("0")){bean.setStatus("专家");}
		if(type.equals("1")){bean.setStatus("取消");}
		beanExpertDao.merge(bean);
	}

	@Override
	public List<BeanBaseInfo> findArticles() {
		BeanBaseInfo bean=new BeanBaseInfo();
		bean.setModuletype("11");
		bean.setColumntype("2");
		return baseInfoDao.findByExample(bean);
	}
	@Override
	public BeanBaseInfo findArticle(Long id){
		return baseInfoDao.findById(id, BeanBaseInfo.class);
	}

}
